package com.potenza.training.resume.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.potenza.training.resume.dao.IamgeExamineDao;
import com.potenza.training.resume.entity.ImageExamineEntity;
import com.potenza.training.resume.service.ImageExamineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("imageExamineService")
public class ImageExamineServiceImpl extends ServiceImpl<IamgeExamineDao, ImageExamineEntity> implements ImageExamineService {

    @Autowired
    IamgeExamineDao iamgeExamineDao;
    @Override
    public void examinImage(ImageExamineEntity imageExamineEntity) {


        iamgeExamineDao.insert(imageExamineEntity);

    }

    @Override
    public List<ImageExamineEntity> findExaminImage(Integer resumeId) {
        QueryWrapper<ImageExamineEntity> imageExamineEntityQueryWrapper = new QueryWrapper<>();
        imageExamineEntityQueryWrapper.lambda().eq(ImageExamineEntity::getResumeId,resumeId);

        return iamgeExamineDao.selectList(imageExamineEntityQueryWrapper);
    }

    @Override
    public ImageExamineEntity findExaminImageById(Integer id) {
        return iamgeExamineDao.selectById(id);
    }
}
